package net.fdukedom.epicurus.service.interaction;

/**
 * 
 * @author Alexander Kirakozov
 *
 */
public abstract class Request extends XMLHelper {	
    /**
     * Request element
     */
    static final protected String REQUEST = "EpicurusRequest";
    
    /**
     * Prefix of xPath
     */
    static final protected String REQUEST_PREFIX = "//" + REQUEST + "/";
	
	/**
     * Plugin element
     */
    static final protected String PLUGIN = "Plugin";
    
    /**
     * Plugin element
     */
    static final protected String ID = "ID";
	
    /**
     * ID value
     */
    protected String idValue = "unknown";
	
	/**
	 * Sets plugin name
	 * 
	 * @value plugin name
	 */
	public void setPluginName(String value) {
		updateRootChildElement(PLUGIN, value);
	}

	/**
	 * Sets request id
	 * 
	 * @value user password
	 */
	protected void setID(String value) {
		updateRootChildElement(ID, value);
	}
	
    /**
     * Returns plugin name
     * 
     * @return plugin name
     */
    public String getPluginName() {
        return getElementValueByXPath(REQUEST_PREFIX + PLUGIN);
    }
    
    /**
     * Returns request id
     * 
     * @return request id
     */
    public String getID() {
        return getElementValueByXPath(REQUEST_PREFIX + ID);
    }
}
